Conversation
| editInVisualBuilderButton: IConfigEditInVisualBuilderButton; | ||
| mode: ILivePreviewMode; | ||
| enableLivePreviewOutsideIframe: boolean; // default: false | ||
| enableLivePreviewOutsideIframe: boolean | undefined; // default: undefined |
There was a problem hiding this comment.
why not this?
| enableLivePreviewOutsideIframe: boolean | undefined; // default: undefined | |
| enableLivePreviewOutsideIframe?: boolean; |
There was a problem hiding this comment.
I initially considered enableLivePreviewOutsideIframe?: boolean, but with exactOptionalPropertyTypes: true that type does not allow explicitly assigning undefined when the key is present in object literals.
In our defaults, we intentionally keep the key present as undefined so the config shape stays consistent and key validation via Config.set continues to work.
| Config.set( | ||
| "enableLivePreviewOutsideIframe", | ||
| initData.enableLivePreviewOutsideIframe ?? | ||
| stackSdk.live_preview?.enableLivePreviewOutsideIframe ?? |
There was a problem hiding this comment.
when and where this stackSdk?.. value is set?
There was a problem hiding this comment.
This stack SDK is directly coming from the user as SDK instance, but the value of enableLivePreviewOutsideIframe will not be present in that.
I’ve removed stackSdk.live_preview?.enableLivePreviewOutsideIframe from the merge chain and now resolve it only from:
- initData.enableLivePreviewOutsideIframe (explicit user input), then
- existing config.enableLivePreviewOutsideIframe.
This keeps behavior explicit and avoids unintended sourcing.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Vp 444 by default bug fix